package com.gp.tms.controller;


import com.gp.tms.pojo.User;
import com.gp.tms.pojo.dto.LoginDto;
import com.gp.tms.service.IUserService;
import com.gp.tms.utils.RespBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author team
 * @since 2023-03-25
 */
@RestController
@RequestMapping("/user")
@Api(tags = "用户接口")
public class UserController {

    @Autowired
    private IUserService userService;

    @PostMapping("/login")
    @ApiOperation("用户登录接口")
    public RespBean<Map<String, String>> userLogin(@RequestBody @Validated LoginDto loginDto, HttpServletRequest request) {
        return userService.userLogin(loginDto, request);
    }

}
